#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include"string.h"

int main() {
    char arr[1000];
    int i = 0;
    scanf("%c", &arr[i]);
    while (arr[i] != '0')
    {
        i++;
        scanf("%c", &arr[i]);
    }
    int a = 0, b = 0;
    for (i = 0; i < strlen(arr); i++)
    {
        if (arr[i] == 'A')
            a++;
        else
            b++;
    }
    if (a > b)
        printf("A");
    if (a < b)
        printf("B");
    if (a == b)
        printf("E");
    return 0;
}